function GetDeviceBaseTest() {

	var myData = [
			['1', "设备1", '密码长度不少于7位', '禁用检查','高','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['2', "设备2", '不检查', '禁用检查','高','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['3', "设备3", '密码长度不少于6位', '不检查','高','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['4', "设备4", '不检查', '禁用检查','高','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['5', "设备5", '密码长度不少于6位', '不检查','高','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2']
	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'device'
						}, {
							name : 'pwdlen'
						}, {
							name : 'telnet'
						}, {
							name : 'hazard'
						}, {
							name : 'createtime'
						}, {
							name : 'creator'
						}, {
							name : 'modifytime'
						}, {
							name : 'modifier'
						}]
			});
			



	store.loadData(myData);
	var nowpage = new Ext.Toolbar.TextItem('1');
	var countpage = new Ext.Toolbar.TextItem('共1页');
	var now_page = 0;
	var count_page = 0;
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '设备',
							width : 100,
							sortable : true,
							dataIndex : 'device'
						}, {
							header : '密码长度检查',
							width : 150,
							sortable : true,
							dataIndex : 'pwdlen'
						}, {
							header : 'telnet禁用检查',
							width : 100,
							sortable : true,
							dataIndex : 'telnet'
						}, {
							header : '危险程度',
							width : 70,
							sortable : true,
							dataIndex : 'hazard'
						}, {
							header : '创建时间',
							width : 150,
							sortable : true,
							dataIndex : 'createtime'
						}, {
							header : '创建者',
							width : 100,
							sortable : true,
							dataIndex : 'creator'
						}, {
							header : '修改时间',
							width : 150,
							sortable : true,
							dataIndex : 'modifytime'
						}, {
							header : '修改者',
							width : 100,
							sortable : true,
							dataIndex : 'modifier'
						}],
				sm : sm,
				tbar : ['选择设备:',{xtype: 'textfield',width : 300},{
							text : '选择',
							tooltip : '选择',
							handler : function() {
								GetLinkDevice();
							}
						},'-',{
							text : '开始检测',
							tooltip : '开始检测',
							handler : function() {
								SetDeviceBaseTest();
							}
						}],
			
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'devicebasegrid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});


	
	
	return grid;
}	


function SetDeviceBaseTest(){
	
	
	var myData = [
			['1', "设备1", '密码长度不少于7位', '禁用检查','高'],
			['2', "设备2", '不检查', '禁用检查','高'],
			['3', "设备3", '密码长度不少于6位', '不检查','高'],
			['4', "设备4", '不检查', '禁用检查','高'],
			['5', "设备5", '密码长度不少于6位', '不检查','高']
	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'device'
						}, {
							name : 'pwdlen'
						}, {
							name : 'telnet'
						}, {
							name : 'hazard'
						}]
			});
			



	store.loadData(myData);
	
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '设备',
							width : 100,
							sortable : true,
							dataIndex : 'device'
						}, {
							header : '密码长度检查',
							width : 150,
							sortable : true,
							dataIndex : 'pwdlen'
						}, {
							header : 'telnet禁用检查',
							width : 100,
							sortable : true,
							dataIndex : 'telnet'
						}, {
							header : '危险程度',
							width : 70,
							sortable : true,
							dataIndex : 'hazard'
						}],
				sm : sm,
			
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'devicebasegrid'
			});
			
	var myData_1 = [
			['1', "密码长度基线", "设备1", '密码长度基线内容', '符合'],
			['2', "telnet禁用基线", "设备2", 'telnet禁用基线内容', '符合'],
			['3', "sftp禁用基线", "设备3", 'sftp禁用基线内容', '不符合'],
			['4', "ping禁用基线", "设备4", 'ping禁用基线内容', '符合'],
			['5', "sftp禁用基线", "设备5", 'sftp禁用基线内容', '不符合'],
			['6', "ping禁用基线", "设备6", 'ping禁用基线内容', '不符合'],
			['7', "telnet禁用基线", "设备7", 'telnet禁用基线内容', '符合'],
			['8', "ping禁用基线", "设备8", 'ping禁用基线内容', '不符合'],
			['9', "sftp禁用基线", "设备9", 'sftp禁用基线内容', '符合'],
			['10', "telnet禁用基线", "设备10", 'telnet禁用基线内容', '不符合']
	];


	var store_1 = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'name'
						}, {
							name : 'device'
						}, {
							name : 'context'
						}, {
							name : 'result'
						}]
			});
			



	store_1.loadData(myData_1);
	
	var sm_1 = new Ext.grid.CheckboxSelectionModel();

	 var store1 = new Ext.data.JsonStore({
        fields: [{name: 'check'},{name: 'x'},{name: 'y'},{name: 'z'},{name: 'z1',type: 'int'}],
        data: [
        {check: '设备1',x: 5,y: 3,z: 6,z1: 6},
        {check: '设备2',x: 3,y: 3,z: 1,z1: 3},
        {check: '设备3',x: 4,y: 4,z: 2,z1: 5},
        {check: '设备4',x: 5,y: 2,z: 3,z1: 2},
        {check: '设备5',x: 6,y: 7,z: 1,z1: 7}
        ]
    })
	var chat1={
						    xtype: 'stackedcolumnchart',
						    store: store1,
						    xField: 'check',
						    xAxis: new Ext.chart.CategoryAxis({
						        title: '设备'
						    }),
						    yAxis: new Ext.chart.NumericAxis({
						        title: "数量"
						    }),
						    series: [{
						        displayName: "严重",
						        yField: 'x'
						    },
						    {
						        displayName: "高",
						        yField: 'y'
						    },
						    {
						        displayName: "中",
						        yField: 'z'
						    },
						    {
						        displayName: "低",
						        yField: 'z1'
						    }],
						    chartStyle: {
						        padding: 10,
						        legend: {
						            display: 'right'
						        }
						    }
							};		
	 var store2 = new Ext.data.JsonStore({
        fields: [{name: 'check'},{name: 'x'},{name: 'y',type: 'int'}],
        data: [
        {check: '密码长度基线',x: 3,y: 3},
        {check: 'telnet禁用基线',x: 3,y: 2},
        {check: 'sftp禁用基线',x: 4,y: 4},
        {check: 'ping禁用基线',x: 4,y: 3},
        {check: 'test禁用基线',x: 7,y: 7}
        ]
    })
	var chat2={
						    xtype: 'stackedcolumnchart',
						    store: store2,
						    xField: 'check',
						    xAxis: new Ext.chart.CategoryAxis({
						        title: '设备'
						    }),
						    yAxis: new Ext.chart.NumericAxis({
						        title: "数量"
						    }),
						    series: [{
						        displayName: "符合此基准的服务器数量",
						        yField: 'x'
						    },
						    {
						        displayName: "不符合此基准的服务器数量",
						        yField: 'y'
						    }
						    ],
						    chartStyle: {
						        padding: 10,
						        legend: {
						            display: 'right'
						        }
						    }
							};		
	var states = [
		['1', '设备'],
		['2', '基线top10']
		];
	var northPanel = new Ext.Panel(	{
							region: 'north',
							height: 300,
							name : 'chat1',
							items : [chat1]
						});
	var gridPanel = new Ext.Panel({
							region: 'center',
							layout : 'fit',
							title:'明细表格',
							items : [grid]
						});		
	var centerPanel = new Ext.Panel({

        region : 'center',
        layout : 'border',
        tbar : [ {
															xtype : 'combo',
															name : 'chatterm1',
															frame : true,
															id : 'chatterm1',
															store : new Ext.data.ArrayStore({
																	fields : ['abbr', 'state'],
																	data : states
																}),
															valueField : 'abbr',
															displayField : 'state',
															typeAhead : true,
															mode : 'local',
															triggerAction : 'all',
															value : '1',
															editable : false,
															width : 140,
															listeners : {
													        select : function (combo, record, index) {
													        	var items=northPanel.items.items;
																			for(var i=0;i<items.length;i++){
																			  	northPanel.remove(items[i]);
																		}
													        	if(record.get('abbr') == '1'){
													        		northPanel.add(chat1);
													        	}else if(record.get('abbr') == '2'){
																			northPanel.add(chat2);
													        	}
																		
																		northPanel.doLayout();

													        	var items=gridPanel.items.items;
																			for(var i=0;i<items.length;i++){
																			  	gridPanel.remove(items[i]);
																		}
													        	if(record.get('abbr') == '1'){
													        			var grid = new Ext.grid.GridPanel({
																								store : store,
																								columns : [sm, {
																											id : 'id',
																											header : 'id',
																											width : 10,
																											sortable : true,
																											dataIndex : 'id',
																											hidden : true
																										}, {
																											header : '设备',
																											width : 100,
																											sortable : true,
																											dataIndex : 'device'
																										}, {
																											header : '密码长度检查',
																											width : 150,
																											sortable : true,
																											dataIndex : 'pwdlen'
																										}, {
																											header : 'telnet禁用检查',
																											width : 100,
																											sortable : true,
																											dataIndex : 'telnet'
																										}, {
																											header : '危险程度',
																											width : 70,
																											sortable : true,
																											dataIndex : 'hazard'
																										}],
																								sm : sm,
																							
																								stripeRows : true,
																								autoExpandColumn : 'id',
																								stateful : true,
																								stateId : 'devicebasegrid'
																							});
													        		gridPanel.add(grid);
													        	}else if(record.get('abbr') == '2'){
													        			var grid_1 = new Ext.grid.GridPanel({
																						store : store_1,
																						columns : [sm_1, {
																									id : 'id',
																									header : 'id',
																									width : 10,
																									sortable : true,
																									dataIndex : 'id',
																									hidden : true
																								}, {
																									header : '名称',
																									width : 100,
																									sortable : true,
																									dataIndex : 'name'
																								}, {
																									header : '设备',
																									width : 100,
																									sortable : true,
																									dataIndex : 'device'
																								}, {
																									header : '基线内容',
																									width : 100,
																									sortable : true,
																									dataIndex : 'context'
																								}, {
																									header : '结果',
																									width : 100,
																									sortable : true,
																									dataIndex : 'result'
																								}],
																						sm : sm_1,
																					
																						stripeRows : true,
																						autoExpandColumn : 'id',
																						stateful : true,
																						stateId : 'devicebasegrid_1'
																					});
																			gridPanel.add(grid_1);
													        	}
																		
																		gridPanel.doLayout();

													   			}
													   	}
								},'-',{
							text : '导出',
							tooltip : '导出',
							iconCls : 'out',
							handler : function() {							
							}
						}],
        items: [
        		northPanel,gridPanel
        ]

			});
    
    
	
	var setWindows = new Ext.Window({
				layout : 'border',
				width : 800,
				height : 650,
				title : "设备基线合规检测",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'hazard',
				items : [centerPanel],
				plain : true
				
			});
	
	setWindows.show();
}